package com.coolwar.jol;

import org.openjdk.jol.info.ClassLayout;
import org.openjdk.jol.vm.VM;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;

public class Test {

    static final Object a = new Object();

    public static void main(String[] args) throws InterruptedException {

        // 偏向锁默认4秒启动
        Thread.sleep(5000);

        //打印JVM的详细信息
        System.out.println(VM.current().details());
        //打印对应的对象头信息
        System.out.println(ClassLayout.parseInstance(a).toPrintable());

        synchronized (a) {
            System.out.println(ClassLayout.parseInstance(a).toPrintable());
        }
    }

}
